package com.ssg.poultry.websocket;

import java.io.IOException;

import javax.websocket.CloseReason;
import javax.websocket.EndpointConfig;
import javax.websocket.Session;
import javax.websocket.server.ServerEndpoint;

@ServerEndpoint("/ws/test")
public class TestWebSocket extends BaseWebSocket {
	

	@Override
	public void onOpen(Session session, EndpointConfig config) {
		
		
	}

	@Override
	public void onMessage(Session session, String msg) {
		logger.debug(this+":receive:"+session.getId()+":"+msg);
		try {
			session.getBasicRemote().sendText(this+":received:"+msg);
		} catch (IOException e) {
			e.printStackTrace();
		}
	}

	@Override
	public void onError(Session session, Throwable throwable) {
		// TODO Auto-generated method stub
		
	}

	@Override
	public void onClose(Session session, CloseReason reason) {
		// TODO Auto-generated method stub
		
	}
	
}
